# This file is part of BlackArch Linux ( https://www.blackarch.org/ ).
# See COPYING for license details.

pkgname=armitage
pkgver=150813
pkgrel=10
epoch=4
groups=('blackarch' 'blackarch-exploitation' 'blackarch-automation')
pkgdesc='A graphical cyber attack management tool for Metasploit.'
url='http://www.fastandeasyhacking.com/'
arch=('any')
license=('GPL')
depends=('metasploit' 'java-environment' 'nmap' 'postgresql' 'ruby-msgpack')
makedepends=('ant' 'zip' 'unzip' 'subversion')
install='armitage.install'
source=("http://www.fastandeasyhacking.com/download/armitage$pkgver.tgz"
        'armitage.install')
sha512sums=('29743c32ff13e62e5cb4a97cf60b3f5e5a4c5ac01a014ff709abc1be4f1b9d795973de357b967a764b4acd4f26d47f6d4517f40c9831672c74e054de2d361e51'
            '6c987c243d2a3a232a1f062a62ff028160fe6aa22296b3a29672b4b3e0a717250de5cd2bda09501789599746ed74f1ccfbbef9f5366dab6eb37c41d38c7c1869')

package() {
  cd $pkgname

  install -dm 755 "$pkgdir/usr/bin"
  install -dm 755 "$pkgdir/usr/share/$pkgname"

  install -Dm644 -t "$pkgdir/usr/share/doc/$pkgname" readme.txt whatsnew.txt

  rm readme.txt whatsnew.txt

  cp -a * "$pkgdir/usr/share/$pkgname"

  cat > "$pkgdir/usr/bin/$pkgname" << EOF
#!/bin/sh
cd /usr/share/armitage
exec ./armitage "\$@"
EOF

  chmod +x "$pkgdir/usr/bin/$pkgname"

  cat > "$pkgdir/usr/bin/teamserver" << EOF
#!/bin/sh
cd /usr/share/armitage
exec ./teamserver "\$@"
EOF

  chmod +x "$pkgdir/usr/bin/teamserver"
}

